#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	n=n/10;
	if(n>=8) cout<<"A";
	else if(n<6) cout<<"C";
	else cout<<"B";
    return 0;
}
